<?php 
   $criteria = new CDbCriteria();
   $criteria->limit = 5;
   $criteria->offset = 0;
   $criteria->order = 'news_id DESC';
   $list_news = News::model()->findAll($criteria);
   //CVarDumper::dump($list_news,10,true);die();
   if(count($list_news) > 0){?>
      <div class="box-list-news">
         <div class="header">Tin mới</div>
         <ul>
            <?php foreach($list_news as $item){
               $link = $item->linkDetail($item->news_id,$item->news_title); ?>
               <li class="news-item">
                  <div class="img-wrap left">
                     <a href="<?php echo $link?>">
                        <img alt="<?php echo CHtml::encode($item->news_title);?>" src="<?php echo Yii::app()->request->baseUrl.'/uploads/pictures/news/thumb_'.$item->news_image;?>" />
                     </a>
                  </div>
                  <div class="text">
                     <div class="title">
                        <a href="<?php echo $link;?>" class="bold main-color"><?php echo $item->news_title;?></a>
                     </div>
                  </div>
               </li>
            <?php }?>
         </ul>
      </div>
   <?php }
?>